package com.baidu.threadSafe;

public class DrawMoneyThread extends Thread{
    //1.将账户对象传入并执行
    private Account account;

    public DrawMoneyThread(Account account, String threadName) {
        this.account = account;
        super.setName(threadName);
    }

    @Override
    public void run() {
        account.drawMoney(10000);
    }
}
